package cn.java86.myschool.web;

import cn.java86.myschool.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
@RestController
@RequestMapping("myschool")//层级之间用 / 隔开
//myschool/sayhi
public class HelloController {
    @GetMapping("sayhi")
    public String sayHello(){
        return "hello world";
    }
    @GetMapping("findUsers")
    public List<User> findUsers(){
        List<User> users=new ArrayList<>();
        for (int i = 1; i < 10; i++) {
            users.add(new User(i,"王"+i,"1334"));
        }
        return users;
    }
}
